//
//  ViewController.m
//  TestIosARC
//
//  Created by huge on 2021/7/27.
//  Copyright © 2021 huge. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

__weak id objTrace;
__weak id objTrace2;

- (void)viewDidLoad {
    [super viewDidLoad];
//    @autoreleasepool{
//        UILabel* lbl = [UILabel new];
//    }
//
    NSArray *localArr = [NSArray arrayWithObject:@"Weng Zilin"];//这是一个局部对象，封装了autorelease方法
    NSArray *localArr2 = [NSArray arrayWithObject:@"Weng Zilin"];//这是一个局部对象，封装了autorelease方法
    UIButton* btn = [[UIButton alloc]init];
    [self.view addSubview:btn];
    NSLog(@"viewWillAppear__localArr:%@", localArr);
    NSDictionary* dic = [NSDictionary dictionaryWithObjectsAndKeys:@"testDic",@"key", nil];
    NSDictionary* dic2 = [NSDictionary dictionaryWithObjectsAndKeys:@"testDic",@"key", nil];
    objTrace = localArr;
    objTrace2 = btn;
    NSLog(@"btn:%@", objTrace2);

//    @autoreleasepool {
//        NSString *str = [NSString stringWithFormat:@"sunnyxx"];
//        objTrace = dic;
//        NSLog(@"viewWillAppear__localArr:%@", objTrace);
//    }


    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    NSLog(@"viewWillAppear__localArr:%@", objTrace);
    NSLog(@"viewWillAppear__localArr:%@", objTrace2);
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    NSLog(@"viewDidAppear:%@", objTrace);
    NSLog(@"viewDidAppear:%@", objTrace2);

}

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    NSLog(@"viewWillDisappear:%@", objTrace2);

}
@end
